Str = input("请输入要统计的随机字符串：")
E, e, number = 0, 0, 0
either = 0
for i in Str:
    if ord("A") <= ord(i) <= ord("Z"):
        E += 1
    elif ord("a") <= ord(i) <= ord("z"):
        E += 1
    elif i in ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']:
        number += 1
    elif i == ' ':
        e += 1
    else:
        either += 1
print("输入的数据中有{}个英文字符，有数字{}个，有空格{}个，其他字符{}个。".format(E, number, e, either))
